<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title><%= title %></title>
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.css">
  <link rel="stylesheet" href="/css/styles.css">
</head>
<body>
  <div class="container-fluid">
    <div class="row">
      <!-- Sidebar -->
      <div class="col-md-3 sidebar">
        <div class="sidebar-header">
          <h1>Impersonaid</h1>
          <p class="text-muted">Documentation Persona Simulator</p>
        </div>
        
        <!-- Document Input Section -->
        <div class="sidebar-section">
          <h5>Document Source</h5>
          <div class="form-check form-check-inline">
            <input class="form-check-input" type="radio" name="documentType" id="urlRadio" value="url" checked>
            <label class="form-check-label" for="urlRadio">URL</label>
          </div>
          <div class="form-check form-check-inline">
            <input class="form-check-input" type="radio" name="documentType" id="markdownRadio" value="markdown">
            <label class="form-check-label" for="markdownRadio">Markdown</label>
          </div>
          
          <!-- URL Input -->
          <div id="urlInputContainer" class="mt-2">
            <div class="input-group">
              <input type="text" class="form-control" id="documentUrl" placeholder="https://example.com/docs">
            </div>
          </div>
          
          <!-- Markdown Input -->
          <div id="markdownInputContainer" class="mt-2 d-none">
            <textarea class="form-control" id="markdownContent" rows="5" placeholder="Paste your markdown content here..."></textarea>
          </div>
        </div>
        

        
        <!-- Persona Selection -->
        <div class="sidebar-section">
          <div class="d-flex justify-content-between align-items-center mb-2">
            <h5 class="mb-0">Persona</h5>
            <a href="/personas" class="btn btn-sm btn-outline-primary">
              <i class="bi bi-pencil"></i> Manage
            </a>
          </div>
          <select class="form-select" id="personaSelect">
            <option value="" selected disabled>Select a persona</option>
            <!-- Personas will be loaded dynamically -->
          </select>
        </div>
        
        <!-- Model Selection -->
        <div class="sidebar-section">
          <h5>Model</h5>
          <select class="form-select" id="modelSelect">
            <option value="" selected disabled>Select a model</option>
            <!-- Models will be loaded dynamically -->
          </select>
        </div>
        

      </div>
      
      <!-- Main Chat Area -->
      <div class="col-md-9 chat-area">
        <div class="chat-container" id="chatContainer">
          <div class="welcome-message">
            <h2>Welcome to Impersonaid</h2>
            <p>Start by selecting a document source on the left panel.</p>
            <p>Then choose a persona and model to simulate user interactions with your documentation.</p>
          </div>
        </div>
        
        <!-- Input Area -->
        <div class="input-area">
          <div class="input-group">
            <input type="text" class="form-control" id="userRequest" placeholder="Ask a question as if you were the selected persona...">
            <button class="btn btn-primary" id="sendRequestBtn">
              <i class="bi bi-send"></i>
            </button>
          </div>
        </div>
      </div>
    </div>
  </div>

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
  <script src="/socket.io/socket.io.js"></script>
  <script src="/js/app.js"></script>
</body>
</html>
